Integrand size = 12, antiderivative size = 65 \[ \int (c+d x) \cot (a+b x) \, dx=-\frac {i (c+d x)^2}{2 d}+\frac {(c+d x) \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {i d \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{2 b^2} \]
[Out]
Time = 0.11 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3798, 2221, 2317, 2438} \[ \int (c+d x) \cot (a+b x) \, dx=-\frac {i d \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{2 b^2}+\frac {(c+d x) \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {i (c+d x)^2}{2 d} \]
[In]
[Out]
Rule 2221
Rule 2317
Rule 2438
Rule 3798
Rubi steps \begin{align*} \text {integral}& = -\frac {i (c+d x)^2}{2 d}-2 i \int \frac {e^{2 i (a+b x)} (c+d x)}{1-e^{2 i (a+b x)}} \, dx \\ & = -\frac {i (c+d x)^2}{2 d}+\frac {(c+d x) \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {d \int \log \left (1-e^{2 i (a+b x)}\right ) \, dx}{b} \\ & = -\frac {i (c+d x)^2}{2 d}+\frac {(c+d x) \log \left (1-e^{2 i (a+b x)}\right )}{b}+\frac {(i d) \text {Subst}\left (\int \frac {\log (1-x)}{x} \, dx,x,e^{2 i (a+b x)}\right )}{2 b^2} \\ & = -\frac {i (c+d x)^2}{2 d}+\frac {(c+d x) \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {i d \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{2 b^2} \\ \end{align*}
Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(192\) vs. \(2(65)=130\).
Time = 5.47 (sec) , antiderivative size = 192, normalized size of antiderivative = 2.95 \[ \int (c+d x) \cot (a+b x) \, dx=\frac {1}{2} d x^2 \cot (a)+\frac {c \log (\cos (a+b x))}{b}+\frac {c \log (\tan (a+b x))}{b}-\frac {d \csc (a) \sec (a) \left (b^2 e^{i \arctan (\tan (a))} x^2+\frac {\left (i b x (-\pi +2 \arctan (\tan (a)))-\pi \log \left (1+e^{-2 i b x}\right )-2 (b x+\arctan (\tan (a))) \log \left (1-e^{2 i (b x+\arctan (\tan (a)))}\right )+\pi \log (\cos (b x))+2 \arctan (\tan (a)) \log (\sin (b x+\arctan (\tan (a))))+i \operatorname {PolyLog}\left (2,e^{2 i (b x+\arctan (\tan (a)))}\right )\right ) \tan (a)}{\sqrt {1+\tan ^2(a)}}\right )}{2 b^2 \sqrt {\sec ^2(a) \left (\cos ^2(a)+\sin ^2(a)\right )}} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 214 vs. \(2 (55 ) = 110\).
Time = 1.00 (sec) , antiderivative size = 215, normalized size of antiderivative = 3.31
method | result | size |
risch | \(-\frac {i d \,x^{2}}{2}+i c x +\frac {c \ln \left ({\mathrm e}^{i \left (x b +a \right )}+1\right )}{b}-\frac {2 c \ln \left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b}+\frac {c \ln \left ({\mathrm e}^{i \left (x b +a \right )}-1\right )}{b}-\frac {2 i d x a}{b}-\frac {i d \,a^{2}}{b^{2}}+\frac {d \ln \left (1-{\mathrm e}^{i \left (x b +a \right )}\right ) x}{b}+\frac {d \ln \left (1-{\mathrm e}^{i \left (x b +a \right )}\right ) a}{b^{2}}-\frac {i d \operatorname {polylog}\left (2, {\mathrm e}^{i \left (x b +a \right )}\right )}{b^{2}}+\frac {d \ln \left ({\mathrm e}^{i \left (x b +a \right )}+1\right ) x}{b}-\frac {i d \operatorname {polylog}\left (2, -{\mathrm e}^{i \left (x b +a \right )}\right )}{b^{2}}+\frac {2 d a \ln \left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b^{2}}-\frac {d a \ln \left ({\mathrm e}^{i \left (x b +a \right )}-1\right )}{b^{2}}\) | \(215\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 250 vs. \(2 (52) = 104\).
Time = 0.27 (sec) , antiderivative size = 250, normalized size of antiderivative = 3.85 \[ \int (c+d x) \cot (a+b x) \, dx=\frac {-i \, d {\rm Li}_2\left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) + i \, d {\rm Li}_2\left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) + i \, d {\rm Li}_2\left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) - i \, d {\rm Li}_2\left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) + {\left (b d x + b c\right )} \log \left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) + {\left (b d x + b c\right )} \log \left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right ) + {\left (b c - a d\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) + {\left (b c - a d\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) - \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) + {\left (b d x + a d\right )} \log \left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) + {\left (b d x + a d\right )} \log \left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right )}{2 \, b^{2}} \]
[In]
[Out]
\[ \int (c+d x) \cot (a+b x) \, dx=\int \left (c + d x\right ) \cos {\left (a + b x \right )} \csc {\left (a + b x \right )}\, dx \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 190 vs. \(2 (52) = 104\).
Time = 0.31 (sec) , antiderivative size = 190, normalized size of antiderivative = 2.92 \[ \int (c+d x) \cot (a+b x) \, dx=\frac {-i \, b^{2} d x^{2} - 2 i \, b^{2} c x - 2 i \, b d x \arctan \left (\sin \left (b x + a\right ), -\cos \left (b x + a\right ) + 1\right ) + 2 i \, b c \arctan \left (\sin \left (b x + a\right ), \cos \left (b x + a\right ) - 1\right ) - 2 \, {\left (-i \, b d x - i \, b c\right )} \arctan \left (\sin \left (b x + a\right ), \cos \left (b x + a\right ) + 1\right ) - 2 i \, d {\rm Li}_2\left (-e^{\left (i \, b x + i \, a\right )}\right ) - 2 i \, d {\rm Li}_2\left (e^{\left (i \, b x + i \, a\right )}\right ) + {\left (b d x + b c\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} + 2 \, \cos \left (b x + a\right ) + 1\right ) + {\left (b d x + b c\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} - 2 \, \cos \left (b x + a\right ) + 1\right )}{2 \, b^{2}} \]
[In]
[Out]
\[ \int (c+d x) \cot (a+b x) \, dx=\int { {\left (d x + c\right )} \cos \left (b x + a\right ) \csc \left (b x + a\right ) \,d x } \]
[In]
[Out]
Timed out. \[ \int (c+d x) \cot (a+b x) \, dx=\int \frac {\cos \left (a+b\,x\right )\,\left (c+d\,x\right )}{\sin \left (a+b\,x\right )} \,d x \]
[In]
[Out]